<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/common/common.jsp"%>
<html>
<head>
    <meta charset="utf-8" />
    <title>厅干部平时考核管理系统</title>
</head>
<body>
<div class="njga" style="overflow: auto;">
    <div class="bmkhlb" style="background:#fff">
        <div class="bmkhlb_main">
            <div class="title">领导评鉴</div>
            <c:if test="${list.size()==0||list==null }">
                <h1 style="color:red;">暂无数据</h1>
            </c:if>
            <c:forEach var="item" items="${list }">
                <table class="bmkhlb_table">
                    <c:choose>
                    <c:when test="${item.confirm=='1'}">
                    <tr class="tr1">
                        </c:when>
                        <c:when test="${item.ldeadersocre1!=''&&item.ldeadersocre1!=null}">
                    <tr class="tr2">
                        </c:when>
                        <c:when test="${item.selflevel1!=''&&item.selflevel1!=null}">
                    <tr class="tr3">
                        </c:when>
                        <c:otherwise>
                    <tr class="tr4">
                        </c:otherwise>
                        </c:choose>

                        <td width="15%">
                            <div class="td1_top">
                                <img src="data:image/png;base64,${item.photo}"/>
                            </div>
                            <div class="td1_bottom">${item.name}</div>
                        </td>
                        <td width="40%">
                            <table class="td2_table">
                                <tr>
                                    <td width="25%"></td>
                                    <td width="15%">德</td>
                                    <td width="15%">能</td>
                                    <td width="15%">勤</td>
                                    <td width="15%">绩</td>
                                    <td width="15%">廉</td>
                                </tr>
                                <tr>
                                    <td>个人自评</td>
                                    <td>${item.selflevel1}</td>
                                    <td>${item.selflevel2}</td>
                                    <td>${item.selflevel3}</td>
                                    <td>${item.selflevel4}</td>
                                    <td>${item.selflevel5}</td>
                                </tr>
                                <tr>
                                    <td>领导评鉴</td>
                                    <td>${item.ldeaderlevel1}</td>
                                    <td>${item.ldeaderlevel2}</td>
                                    <td>${item.ldeaderlevel3}</td>
                                    <td>${item.ldeaderlevel4}</td>
                                    <td>${item.ldeaderlevel5}</td>
                                </tr>
                                <tr>
                                    <td>领导打分</td>
                                    <td>${item.ldeadersocre1}</td>
                                    <td>${item.ldeadersocre2}</td>
                                    <td>${item.ldeadersocre3}</td>
                                    <td>${item.ldeadersocre4}</td>
                                    <td>${item.ldeadersocre5}</td>
                                </tr>
                            </table>
                        </td>
                        <td width="15%">
                            <c:if test="${item.totalscore ==''|| item.totalscore ==null}">
                                <div class="td3_top td3_top1">
                                    <span>
                                    0</span>分
                                </div>
                            </c:if>
                            <c:if test="${item.totalscore !=''&& item.totalscore !=null}">
                                <div class="td3_top">
                                    <span>
                                            ${item.totalscore}</span>分
                                </div>
                            </c:if>
                            <div class="td3_bottom">总分</div>
                        </td>
                        <td width="15%">
                            <div class="td3_top td4_top">
                                <c:choose>
                                    <c:when test="${item.confirm=='1'}">
                                        已确认
                                    </c:when>
                                    <c:when test="${item.ldeadersocre1!=''&&item.ldeadersocre1!=null}">
                                        已打分
                                    </c:when>
                                    <c:when test="${item.selflevel1!=''&&item.selflevel1!=null}">
                                        未打分
                                    </c:when>
                                    <c:otherwise>
                                        未自评
                                    </c:otherwise>
                                </c:choose>
                            </div>
                            <div class="td3_bottom">状态</div>
                        </td>
                        <td width="15%">
                            <c:choose>
                                <c:when test="${iszhz ==1&&type==0 }">
                                    <c:if test="${item.confirm=='1'||(item.selflevel1!=''&&item.selflevel1!=null)}">
                                        <span class="td4_span td4_span1"
                                              onclick="javascript:viewData(${item.dbid},0)">查看</span>
                                    </c:if>
                                    <c:if test="${item.confirm=='0'&&item.ldeadersocre1!=''&&item.ldeadersocre1!=null}">
                                        <span class="td4_span td4_span1"
                                              onclick="javascript:confirmData(${item.dbid},0)">确认</span>
                                    </c:if>

                                </c:when>
                                <c:otherwise>
                                    <c:choose>
                                        <c:when test="${item.confirm=='1'}">
                                    <span class="td4_span td4_span1"
                                          onclick="javascript:viewData(${item.dbid},${type})">查看</span>
                                        </c:when>
                                        <c:when test="${item.ldeadersocre1!=''&&item.ldeadersocre1!=null}">
                                    <span class="td4_span td4_span1"
                                          onclick="javascript:viewData(${item.dbid},${type})">查看</span>
                                        </c:when>
                                        <c:when test="${item.selflevel1!=''&&item.selflevel1!=null}">
                                    <span class="td4_span td4_span1"
                                          onclick="javascript:viewData(${item.dbid},${type})">评鉴</span>
                                        </c:when>
                                        <c:otherwise>
                                            <span class="td4_span td4_span1" onclick="alert('催办成功')">催办</span>
                                        </c:otherwise>
                                    </c:choose>
                                </c:otherwise>
                            </c:choose>

                        </td>
                    </tr>
                </table>
            </c:forEach>

            <%--    <table class="bmkhlb_table">
                    <tr class="tr1">
                        <td width="15%">
                            <div class="td1_top">
                                <img src="<c:url value='/resource/jxkh/images/head1.jpg'/>" />
                            </div>
                            <div class="td1_bottom">黄子涛</div>
                        </td>
                        <td width="40%">
                            <table class="td2_table">
                                <tr>
                                    <td width="25%"></td>
                                    <td width="15%">德</td>
                                    <td width="15%">能</td>
                                    <td width="15%">勤</td>
                                    <td width="15%">绩</td>
                                    <td width="15%">廉</td>
                                </tr>
                                <tr>
                                    <td>个人自评</td>
                                    <td>A</td>
                                    <td>B</td>
                                    <td>A</td>
                                    <td>A</td>
                                    <td>A</td>
                                </tr>
                                <tr>
                                    <td>领导评鉴</td>
                                    <td>A</td>
                                    <td>B</td>
                                    <td>B</td>
                                    <td>A</td>
                                    <td>A</td>
                                </tr>
                                <tr>
                                    <td>领导打分</td>
                                    <td>20</td>
                                    <td>12</td>
                                    <td>12</td>
                                    <td>39</td>
                                    <td>10</td>
                                </tr>
                            </table>
                        </td>
                        <td width="15%">
                            <div class="td3_top">
                                <span>93</span>分
                            </div>
                            <div class="td3_bottom">总分</div>
                        </td>
                        <td width="15%">
                            <div class="td3_top td4_top">
                                已确认
                            </div>
                            <div class="td3_bottom">状态</div>
                        </td>
                        <td width="15%">
                            <span class="td4_span td4_span1">查看</span>
                        </td>
                    </tr>
                </table>
                <table class="bmkhlb_table">
                    <tr class="tr2">
                        <td width="15%">
                            <div class="td1_top">
                                <img src="<c:url value='/resource/jxkh/images/head1.jpg'/>" />
                            </div>
                            <div class="td1_bottom">张继禹</div>
                        </td>
                        <td width="40%">
                            <table class="td2_table">
                                <tr>
                                    <td width="25%"></td>
                                    <td width="15%">德</td>
                                    <td width="15%">能</td>
                                    <td width="15%">勤</td>
                                    <td width="15%">绩</td>
                                    <td width="15%">廉</td>
                                </tr>
                                <tr>
                                    <td>个人自评</td>
                                    <td>A</td>
                                    <td>B</td>
                                    <td>A</td>
                                    <td>A</td>
                                    <td>A</td>
                                </tr>
                                <tr>
                                    <td>领导评鉴</td>
                                    <td>A</td>
                                    <td>B</td>
                                    <td>B</td>
                                    <td>A</td>
                                    <td>A</td>
                                </tr>
                                <tr>
                                    <td>领导打分</td>
                                    <td>20</td>
                                    <td>12</td>
                                    <td>12</td>
                                    <td>39</td>
                                    <td>10</td>
                                </tr>
                            </table>
                        </td>
                        <td width="15%">
                            <div class="td3_top">
                                <span>99</span>分
                            </div>
                            <div class="td3_bottom">总分</div>
                        </td>
                        <td width="15%">
                            <div class="td3_top td4_top">
                                已打分
                            </div>
                            <div class="td3_bottom">状态</div>
                        </td>
                        <td width="15%">
                            <span class="td4_span td4_span1">查看</span>
                        </td>
                    </tr>
                </table>
                <table class="bmkhlb_table">
                    <tr class="tr3">
                        <td width="15%">
                            <div class="td1_top">
                                <img src="<c:url value='/resource/jxkh/images/head1.jpg'/>" />
                            </div>
                            <div class="td1_bottom">李雨</div>
                        </td>
                        <td width="40%">
                            <table class="td2_table">
                                <tr>
                                    <td width="25%"></td>
                                    <td width="15%">德</td>
                                    <td width="15%">能</td>
                                    <td width="15%">勤</td>
                                    <td width="15%">绩</td>
                                    <td width="15%">廉</td>
                                </tr>
                                <tr>
                                    <td>个人自评</td>
                                    <td>A</td>
                                    <td>B</td>
                                    <td>A</td>
                                    <td>A</td>
                                    <td>A</td>
                                </tr>
                                <tr>
                                    <td>领导评鉴</td>
                                    <td></td>
                                    <td></td>
                                    <td></td>
                                    <td></td>
                                    <td></td>
                                </tr>
                                <tr>
                                    <td>领导打分</td>
                                    <td></td>
                                    <td></td>
                                    <td></td>
                                    <td></td>
                                    <td></td>
                                </tr>
                            </table>
                        </td>
                        <td width="15%">
                            <div class="td3_top td3_top1">
                                <span>0</span>分
                            </div>
                            <div class="td3_bottom">总分</div>
                        </td>
                        <td width="15%">
                            <div class="td3_top td4_top">
                                未打分
                            </div>
                            <div class="td3_bottom">状态</div>
                        </td>
                        <td width="15%">
                            <span class="td4_span td4_span1">评鉴</span>
                        </td>
                    </tr>
                </table>
                <table class="bmkhlb_table">
                    <tr class="tr4">
                        <td width="15%">
                            <div class="td1_top">
                                <img src="<c:url value='/resource/jxkh/images/head1.jpg'/>" />
                            </div>
                            <div class="td1_bottom">王立刚</div>
                        </td>
                        <td width="40%">
                            <table class="td2_table">
                                <tr>
                                    <td width="25%"></td>
                                    <td width="15%">德</td>
                                    <td width="15%">能</td>
                                    <td width="15%">勤</td>
                                    <td width="15%">绩</td>
                                    <td width="15%">廉</td>
                                </tr>
                                <tr>
                                    <td>个人自评</td>
                                    <td></td>
                                    <td></td>
                                    <td></td>
                                    <td></td>
                                    <td></td>
                                </tr>
                                <tr>
                                    <td>领导评鉴</td>
                                    <td></td>
                                    <td></td>
                                    <td></td>
                                    <td></td>
                                    <td></td>
                                </tr>
                                <tr>
                                    <td>领导打分</td>
                                    <td></td>
                                    <td></td>
                                    <td></td>
                                    <td></td>
                                    <td></td>
                                </tr>
                            </table>
                        </td>
                        <td width="15%">
                            <div class="td3_top td3_top1">
                                <span>0</span>分
                            </div>
                            <div class="td3_bottom">总分</div>
                        </td>
                        <td width="15%">
                            <div class="td3_top td4_top">
                                未自评
                            </div>
                            <div class="td3_bottom">状态</div>
                        </td>
                        <td width="15%">
                            <span class="td4_span td4_span1">催办</span>
                        </td>
                    </tr>
                </table>--%>
        </div>
    </div>

</div>


<script type="text/javascript">
    function getContentSize() {
       /* var ew = document.getElementById("bmkhcp").offsetWidth; //获取id=njga_bottom现在的宽度
        bmkhcp_lf = (ew - 356) + "px";
        document.getElementById("bmkhcp_lf").style.width = bmkhcp_lf;*/
    }
    window.onload = getContentSize; //页面加载时调用getContentSize()
    window.onresize = getContentSize; //当改变窗口大小时会出发getContentSize()
    $(document).ready(function () {

        //领导评鉴-选择分数
        $(document).click(function () {
            $(".bmkhlb_select_xl").slideUp(200);
        });
        $(".bmkhlb_select1").click(function (e) {
            e = e || window.event;
            if (e.stopPropagation) {
                e.stopPropagation();
            } else {
                e.cancelBubble = true;
            }
            $(this).next(".bmkhlb_select_xl").slideToggle(200);
            $(this).parent(".bmkhlb_select").siblings(".bmkhlb_select").children(".bmkhlb_select_xl").hide();
            var selecttext = $(this).children("p");
            var selectmain = $(this).next(".bmkhlb_select_xl");
            var lis = selectmain.find('li');
            for (var i = 0; i < lis.length; i++) {
                lis[i].onclick = function () {
                    selectmain.hide();
                    var textval = $(this).html();
                    selecttext.text(decodeURIComponent(textval));
                }
            }
        });
        //领导评鉴-选择分数结束
    })

    function viewData(dbid, type) {
        var url = "<c:url value='/evaluation/ldpj/@.html?type=#'/>".replace("@", dbid).replace("#", type);
        $('#ifrm_data', parent.document).attr("src", url);
    }
    function confirmData(dbid){
        $.ajax({
           url:"<c:url value='/evaluation/confirmData/@.json'/>".replace("@",dbid),
            type:"post",
            dataType:"json",
            success:function(data){
                if (data.data.status == 1) {
                    showMessage('操作成功！');
                    window.setTimeout(function () {
                        var url = "<c:url value='/evaluation/ldpj_list/@.html'/>".replace("@","${type }");
                        $('#ifrm_data', parent.document).attr("src", url);
                    }, 1500);
                } else {
                    showMessage(data.data.body);
                }
            },
            error:function(){
                showMessage("操作失败！");
            }
        });
    }
    function showMessage(content) {
        layer.open({
            title: '信息'
            , content: content
        });
    }
</script>
</body>

</html>